from passlib.hash import pbkdf2_sha256


def hash_password(password):
    return pbkdf2_sha256.hash(password)

def check_password(password, hashed_password):
    return pbkdf2_sha256.verify(password, hashed_password)


if __name__ == '__main__':
    pwd = 123456
    hash_pas = hash_password(f'{pwd}')
    print("加密",hash_pas)
    var_pas = check_password(f'{pwd}', hash_pas)
    print("解密", var_pas)